JPEGLIB = /home/raii/KzLab/v3s/jpeg/v3sInstall
LVGLPATH = /home/raii/GitHubToyBox/lvglCollection
LVGL_PATH = $(LVGLPATH)/lvgl
LDFLAGS = -L$(JPEGLIB)/lib
LIBS = -ljpeg -lpthread
CC = arm-linux-gnueabihf-gcc
INCLUDE = -I$(JPEGLIB)/include -I$(LVGLPATH) -I$(LVGLPATH)/lvgl -I$(LVGLPATH)/lv_drivers -I/home/raii/KzLab/EqptDrillApp
CSTD = -std=c99
OBJDIR = /home/raii/KzLab/EqptDrillApp/temp
EXE = /home/raii/KzLab/EqptDrillApp/exe

CFLAGS += -DLV_CONF_INCLUDE_SIMPLE
CFLAGS += -DLV_LVGL_H_INCLUDE_SIMPLE
CFLAGS += -DLV_USE_DEMO_WIDGETS
include $(LVGLPATH)/lv_drivers/lv_drivers.mk
include $(LVGLPATH)/lvgl/lvgl.mk

CXX_OBJCTS = $(patsubst  %.c, $(OBJDIR)/%.o, $(notdir $(CSRCS)))
SOURSE_DIR = $(dir $(CSRCS))
vpath %.c $(SOURSE_DIR)

eqptDrillApp : objs

$(OBJDIR)/%.o : %.c
	$(CC) $(INCLUDE) -c $< -o $@ $(CSTD) $(CFLAGS)

objs : $(CXX_OBJCTS) ui v4l2_camera ping main log input remoter
	$(CC) -o $(EXE)/console $(CXX_OBJCTS) $(OBJDIR)/ui.o $(OBJDIR)/v4l2_camera.o $(OBJDIR)/ping.o $(OBJDIR)/main.o $(OBJDIR)/log.o $(OBJDIR)/input.o $(OBJDIR)/remoter.o $(AOBJS) $(LDFLAGS) $(LIBS) $(CSTD)

ui : ui.c
	$(CC) $(INCLUDE) -c ui.c -o $(OBJDIR)/ui.o $(CSTD) $(LDFLAGS) $(LIBS)

v4l2_camera : v4l2_camera.c
	$(CC) $(INCLUDE) -c v4l2_camera.c -o $(OBJDIR)/v4l2_camera.o $(CSTD) $(LDFLAGS) $(LIBS)

ping : ping.c
	$(CC) $(INCLUDE) -c ping.c -o $(OBJDIR)/ping.o $(CSTD) $(LDFLAGS) $(LIBS)

main : main.c
	$(CC) $(INCLUDE) -c main.c -o $(OBJDIR)/main.o $(CSTD) $(LDFLAGS) $(LIBS)

log : log.c
	$(CC) $(INCLUDE) -c log.c -o $(OBJDIR)/log.o $(CSTD) $(LDFLAGS) $(LIBS)

input : input.c
	$(CC) $(INCLUDE) -c input.c -o $(OBJDIR)/input.o $(CSTD) $(LDFLAGS) $(LIBS)

remoter : remoter.c
	$(CC) $(INCLUDE) -c remoter.c -o $(OBJDIR)/remoter.o $(CSTD) $(LDFLAGS) $(LIBS)